﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using RBAC.DAL.Entities;

namespace RBAC.DAL.Mappers
{
    public class RoleUserMap : ClassMap<RoleUser>
    {
        public RoleUserMap()
        {
            Id(x => x.Id);



            //Map(x => x.CreateDate).Not.Nullable();

            References(x => x.Role).Cascade.All();

     References(x => x.User).Cascade.All();

            // BaseEntity
            //References(x => x.CreateBy).Cascade.All();
            Map(x => x.CreateById).Nullable();

            Map(x => x.CreateDate).Not.Nullable();

            Map(x => x.IsActive).Not.Nullable();

            Map(x => x.ProjectId).Not.Nullable();
        }

    }
}